package com.starlinkdt.common.enums;

import lombok.Getter;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 应用状态
 * 
 * @author system
 */
@Getter
public enum DisableStatus
{
    /**
     * 启用
     */
    ENABLE("0", "启用"),

    /**
     * 是
     */
    DISABLE("1", "禁用"),
    ;

    /**
     * 定义
     */
    private final String type;

    /**
     * 描述
     */
    private final String desc;

    DisableStatus(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    /**
     * 查询map
     */
    private static final Map<String, DisableStatus> MAP = new LinkedHashMap<>();

    static {
        for (DisableStatus enumData : DisableStatus.values()) {
            MAP.put(enumData.getType(), enumData);
        }
    }

    public static DisableStatus getEnumByType(String type) {
        return MAP.get(type);
    }

    /**
     * map
     */
    public static final Map<String, String> EnumMAP = new LinkedHashMap<>();

    static {
        for (DisableStatus enumData : DisableStatus.values()) {
            EnumMAP.put(enumData.getType(), enumData.getDesc());
        }
    }

}
